﻿using System;

using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
using Sautom.ClientComunication;
using Sautom.Modules.Proposal.Views;

namespace Sautom.Modules.Proposal
{
    public class ModuleInit : IModule
    {
        private readonly IUnityContainer _container;
        private readonly IRegionManager _regionManager;

        public ModuleInit(IUnityContainer container, IRegionManager regionManager)
        {
            _container = container;
            _regionManager = regionManager;
        }

        #region IModule Members

        public void Initialize()
        {
            _container.RegisterType<Object, ProposalIndex>(PathProvider.ProposalIndex);
            _container.RegisterType<Object, ProposalEdit>(PathProvider.ProposalEdit);
            _container.RegisterType<Object, CountriesList>(PathProvider.CountriesList);
            _container.RegisterType<Object, CountryEdit>(PathProvider.CountryEdit);
            _container.RegisterType<Object, ModuleTaskButton>(PathProvider.ProposalTaskButton); 
            _container.RegisterType<Object, RateManagement>(PathProvider.RateManagement);

            _regionManager.RequestNavigate(RegionProvider.TaskButtonRegion, PathProvider.ProposalTaskButton);
            //_regionManager.RequestNavigate(RegionProvider.MainRegion, PathProvider.ProposalIndex);
        }

        #endregion
    }
}
